package other;

import java.util.Scanner;

public class YHSJ {
    public static void main(String[] args) {
        //定义最大数值
        System.out.println("请输入您要打印的杨辉三角高度");
        Scanner scanner = new Scanner(System.in);
        int max = scanner.nextInt();
        //搞个二维数组   先搞x坐标  也就是max行
        int[][] nums = new int[max][];
        for (int i = 0; i < nums.length; i++) {
            nums[i] = new int[i+1];
        }


        // max行里的第一个值和最后一个值搞成1 这是规律
        for (int i = 0; i < max; i++) {
            nums[i][0] = 1;
            nums[i][nums[i].length-1] = 1;
        }



        //打印
        for (int i = 0; i <nums.length ; i++) {
            for (int j = 0; j < nums[i].length; j++) {
                System.out.print(nums[i][j] + " ");
            }
            System.out.println();
        }
    }
}
